package com.xyw.code.study20200813.test;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/9/1
 * Time: 上午9:40
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
public class ThreadTest3 implements Runnable{ // 实现Runnable接口
    public void run(){  // 覆写run()方法
        while(true){
            System.out.println(Thread.currentThread().getName() + "在运行。") ;
        }
    }
    public static void main(String args[]){
        ThreadTest3 mt = new ThreadTest3() ;  // 实例化Runnable子类对象
        Thread t = new Thread(mt,"线程");     // 实例化Thread对象
        t.setDaemon(false) ; // 此线程在后台运行
        t.start() ; // 启动线程
    }
};

